package escom.dds.modelo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "calificaciones")
public class Calificacion implements Serializable{
	
	private Integer id;
	
	private Double puntaje;
	
	private Integer idExamen;
	
	private Examen examen;
	
	private Integer matricula;
	
	private Alumno alumno;
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name="id", nullable = false)
	public Integer getId() {
		return id;
	}
	
	public void setId(Integer id) {
		this.id = id;
	}
	
	@Column(name = "puntaje")
	public Double getPuntaje() {
		return puntaje;
	}
	
	public void setPuntaje(Double puntaje) {
		this.puntaje = puntaje;
	}
	
	@Column(name = "idExamen", nullable = true)
	public Integer getIdExamen() {
		return idExamen;
	}
	
	public void setIdExamen(Integer idExamen) {
		this.idExamen = idExamen;
	}
	
	@ManyToOne
	@JoinColumn(name = "idExamen", referencedColumnName = "id", updatable = false, insertable = false)
	public Examen getExamen() {
		return examen;
	}
	
	public void setExamen(Examen examen) {
		this.examen = examen;
	}
	
	@Column(name = "matricula", nullable = true)
	public Integer getMatricula() {
		return matricula;
	}
	
	public void setMatricula(Integer matricula) {
		this.matricula = matricula;
	}
	
	@ManyToOne
	@JoinColumn(name = "matricula", referencedColumnName = "matricula", insertable = false, updatable = false)
	public Alumno getAlumno() {
		return alumno;
	}
	
	public void setAlumno(Alumno alumno) {
		this.alumno = alumno;
	}
}
